﻿<!DOCTYPE html>
<html>
<head>
    <title>企动小程序网站</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="keywords" content="企动小程序网站">
    <script src="/Scripts/jquery.js"></script>
    <script src="/Scripts/com.js"></script>
    <script src="/Scripts/config.js"></script>
    <style>
        body {margin:0px; padding:0px; font-size:16px;}
        a{ text-decoration:none;}
    </style>
    <script>
        window.onload = function () {
            var host = window.location.host;
            if (host.indexOf("711688.com.cn") > -1)
                toDefaultPage(getQuery("storeid"));
            else
                toUserPage();
        }

        function toUserPage() {
            var homeUrl = 'http://www.711688.net.cn';
            var storeUrl = 'http://weadmin.711688.net.cn/storeadmin/?path=%2Fstoreadmin%2Fstore%2Feditstore#nav=1';
            var url = siteUrl.fotmatUrl(siteUrl.GetStoreIdByWebsite.replace("{website}", window.location.host));
            AjaxGet(url, "", function (data) {
                if (!checkCode(data)) {
                    $(".msg").html(data.Message + "<div style='margin-top:10px;'><a href='" + homeUrl + "'>5秒后跳转到首页，立即跳转</a></div>");    //显示错误消息
                    setTimeout(function () { window.location.href = homeUrl; }, 4500);
                    return;
                }

                if (data.Data != null && data.Data != '0') {
                    toHomePage(data.Data);
                    return;
                }
                                
                $(".msg").html("<div style='margin-top:10px;'><a href='" + storeUrl + "'>域名未绑定，请在企动小程序—店铺信息中绑定，点击立即绑定</a></div>");    //显示错误消息
                setTimeout(function () { window.location.href = storeUrl; }, 6000);

            });
        }

        function toHomePage(storeid) {
            window.location.href = 'pages/index.html?storeid=' + storeid;
        }
    </script>
</head>
<body>
    <div class="msg">正在加载...</div>
</body>
</html>
